var express = require('express');
var router = express.Router();
const { HygieneModel,AcceptanceModel } = require('../db/index');


router.get('/HygieneList', async function (req, res, next) {
    try {
        let data = await HygieneModel.find();
        res.json({
            code:200,
            data
        })
    } catch (error) {
        return res.json({
            code:500,
            message:'服务器错误'
        })
    }
})


router.get('/AcceptanceList', async (req, res) => {
    try {
        let data = await AcceptanceModel.find()
        res.json({
            code: 200,
            message:'请求成功',
            data
        })
    } catch (error) {
        res.json({
            code: 500,
            message:error.message
        })
    }
});



/* GET users listing. */
router.get('/', function (req, res, next) {
  res.send('respond with a resource');
});

module.exports = router;